/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.segu.dto;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 *
 * @author Ronald
 */
@Entity
@Table(name = "TSEGU_PERMISO_ROL")
public class PermisoRolDto implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_TSEGU_PERMISO_ROL")
    @TableGenerator(name = "SEQ_TSEGU_PERMISO_ROL",  table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "TSEGU_PERMISO_ROL", allocationSize = 1)
    private Long id;
    @Column(name = "ESTADO")
    private Boolean estado;
    @JoinColumn(name = "ROL", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private RolDto rolDto;
    @JoinColumn(name = "OPCION_SISTEMA", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private OpcionSistemaDto opcionSistemaDto;

    public PermisoRolDto() {
    }

    public PermisoRolDto(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getEstado() {
        return estado;
    }

    public void setEstado(Boolean estado) {
        this.estado = estado;
    }

    public RolDto getRolDto() {
        return rolDto;
    }

    public void setRolDto(RolDto rolDto) {
        this.rolDto = rolDto;
    }

    public OpcionSistemaDto getOpcionSistemaDto() {
        return opcionSistemaDto;
    }

    public void setOpcionSistemaDto(OpcionSistemaDto opcionSistemaDto) {
        this.opcionSistemaDto = opcionSistemaDto;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PermisoRolDto)) {
            return false;
        }
        PermisoRolDto other = (PermisoRolDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.brain.segu.dto.PermisoRolDto[ id=" + id + " ]";
    }
    
}
